Skip to content

v0: Phases 1–2 (SDK, native cores, web, verification) - #20

Draft
adhorodyski wants to merge 76 commits into
v0from
v0-impl
Draft

adhorodyski wants to merge 76 commits into
v0from
v0-impl

Conversation

@adhorodyski

@adhorodyski adhorodyski commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Phases 1–2 of the v0 plan (Tasks 6b and 10–32) on top of the Phase 0 harness on v0:

  • the context patch, the Metro and Vite helpers and startReactNativeSdk (mobile and web);
  • the Kotlin and Swift cores and the Nitro adapters, with native-first init;
  • an Expo app that inits from JS;
  • failure, perf and smoke scenarios;
  • an official-Collector compliance job;
  • the nightly and release workflows, and the docs.

Nothing is published or tagged: npm latest is still 0.2.0 and the only tag is v0.2.0.

Verification proof

CI: run 45358145497 is green on all 9 jobs: static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo, e2e-web, compliance and budget. Every job uploads verify/artifacts as verify-artifacts-<job>.

Compliance: the official Collector (otel/opentelemetry-collector:0.165.0) accepted 110 raw requests captured from every e2e target and all 84 expected files, with no errors. NaN and Infinity values are accepted as-is.

Perf (perf.json artifact, measured on android-bare in a test-mode build):

local Pixel_9 (arm64, API 36) CI emulator (x86_64, API 35) budget
hand-off p50 / p95 per span (start, 10 × setAttribute, end) 27 µs / 55 µs 76.9 µs / 686 µs p50 < 100 µs
patch ratio, median(on) / median(off), 5 × 20k awaits 1.70× 2.19× < 3×

Results by scenario and target

✅ means the output equals that platform's expected file (shape first, then an exact compare). "core" columns are the fast JVM and Swift replays of the hand-off fixtures. Smoke runs with test mode off and checks count and names only.

scenario jest kotlin core swift core android-bare ios-bare android-expo ios-expo web
handoff-basic, rich-span, odd-attributes, nest-after-await, nest-promise-all-race, nest-timers-microtasks, async-generator, captured-then, batching-shared-queue, concurrent-interleaved, error-in-callback, interval-new-root, never-settling-promise, root-no-leak ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
export-headers (x-api-key header asserted) ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
smoke-js ✅ ✅ ✅ – – – – –
degraded-probe (native async kept) ✅ – – – – – – –
nest-raf – – – ✅ ✅ ✅ ✅ ✅
event-emitter-listener – – – ✅ ✅ ✅ ✅ –
cross-js-to-native, cross-native-to-js (TestNative Nitro module) – – – ✅ ✅ ✅ ✅ –
collector-down (503 ×3, then delivered once) – – – ✅ ✅ ✅ ✅ ✅
background-flush, flush-after-reload – – – ✅ ✅ ✅ ✅ –
native-init-failure (exactly one error, no-op) – – – ✅ ✅ – (no native init) – –
smoke-device (test mode off) – – – ✅ ✅ nightly nightly –
perf-budget – – – ✅ – – – –
fast-refresh-idempotent – – – local dev build ✅ local dev build ✅ – – –
interaction-manager pending: RN 0.88 removed InteractionManager

The nightly and release workflows each passed one dry run from this PR: Nightly 45353782459 (13 entries) and Release 45353782465. Their temporary PR triggers have since been removed. The real schedule and dispatch runs can only be verified after merging to main.

Decisions for you (defaults applied; override in review)

  1. Task 9 gate defaults:
    • odd-attributes contract: NaN and Inf as doubles, -0 → int 0.
    • minSdk 26.
    • one-span bodies.
    • smoke checks count and names only.
    • the cross-boundary scenarios are split in two, so spec §8 item 7 is covered by several traces rather than one combined trace.
  2. Drafted expected files: every verify/expected/*.{js,android,ios,web}.otlp.json needs your review (CODEOWNERS).
  3. Web (R7): web builds its own TracerProvider with the OTLP proto exporter instead of startBrowserSdk. Spec §7 is rewritten and @opentelemetry/browser-sdk is removed.
  4. iOS output gaps:
    • opentelemetry-swift 2.6's encoder never writes span and link flags or traceState, or the scope schemaUrl. This is recorded as a limitation, not reimplemented.
    • times are quantized to about 240 ns.
    • an iOS TRACEPARENT env var is adopted as the parent of every root span (upstream behaviour).
  5. iOS packaging (R24): iOS ships two pods. Apps add pod 'ReactNativeOpenTelemetryCore' to their Podfile, and Expo apps use the shipped app.plugin.js. This conflicts with the spec rule "nothing essential may depend on a config plugin". Also, autolinking picks between the two root podspecs by sort order, because RN CLI 20.2 and Expo 58 ignore podspecPath. The alternative is to move the Core podspec out of the package root.
  6. Supported platforms:
    • RN 0.79 doesn't build for iOS on Xcode 27 (an fmt compile error).
    • The README states that only Xcode 27 with RN 0.88.1 is verified.
    • Decide whether to raise the iOS minimum RN.
  7. Test-mode behaviour:
    • the native export delay is 120 s, so the background and reload tests can't pass on the timer alone.
    • reload goes through a native reload in TestNative, because DevSettings.reload doesn't work in release builds.
    • fast refresh is checked locally only.
    • smoke with test mode off runs per PR on bare only, with Expo smoke nightly.
    • a deps-latest failure blocks the nightly status.
  8. Release:
    • a minor changeset (0.3.0) published to next, only from green-CI commits on main.
    • promote to latest needs a green nightly.
    • you need to create the npm environment with NPM_TOKEN and enable "Allow GitHub Actions to create pull requests".
  9. Open gaps:
    • interaction-manager: drop it, or patch requestIdleCallback.
    • web has no test for flushing on page hide.
    • CI perf headroom is about 23% on the x86 emulator.
    • ios-expo background-flush failed twice on overloaded runners and passed on retry. It is 7/7 locally, so it may be flaky, but a real bug on that path hasn't been ruled out.

Full verification docs: verify/VERIFY.md. Install and usage: README.md and MIGRATION.md.

🤖 Generated with Claude Code

adhorodyski and others added 30 commits November 23, 2026 20:00
…R CI on v0, always upload artifacts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… CI screen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on failure

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…redact them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…~60 s per call on a runner)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nners

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RNContextManager (StackContextManager + swap), installContextPatch with the
globalThis marker holding the originals and the singleton (R3), src/setup.ts
loaded by the scenarios Jest project. Un-pends the 11 Task 10 scenarios,
adds the unit Jest project (R15), computes fixture NAMES from active Jest
scenarios (R6) and drafts the new .js.otlp.json and .handoff.json files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nchor wording

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al test target

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e replays

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll fails (R1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es lib/

The example consumes the package (exports -> lib/), so the SDK entry (setup, patch, probe,
startReactNativeSdk, hand-off) is in the bundle: 383873 -> 393429 B (+9.6 kB, all lib/module).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…exporter (R7)

Per ruling R7: own sdk-trace TracerProvider + BatchSpanProcessor(OTLP proto)
instead of startBrowserSdk; shared marker/registration with mobile start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adhorodyski and others added 24 commits November 24, 2026 06:22
…es web flush latency

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r OTEL_TEST_MODE change

The bundle task's inputs cover example/ only, so a change to the package, the
scenarios or the test-mode flag left the previous bundle in the APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a failed e2e

- 5 alternating rounds of 20,000 awaits per leg, ratio = median(on)/median(off),
  every sample in perf.json; gates use unrounded values; perf.json says test-mode build.
- example-expo: the config plugin adds the same bundle-task inputs as the bare app.
- CI: smoke runs even when the main e2e failed and the step exits with the first
  non-zero code; paths use ${{ runner.temp }}.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .github/workflows/scheduled.yml: one `e2e` matrix (RN 0.79 / latest with example/ regenerated, deps at latest +
  fast loop, npm pack into a fresh bare app and the Expo app with smoke-device, API 26 smoke, dev builds with
  fast-refresh-idempotent); `mark-nightly` sets the `nightly` commit status. TEMPORARY pull_request trigger
  (paths: the workflow) runs in dry-run mode (R28).
- verify/nightly/app.sh: `bare <rn>` regenerates example/ native projects and re-applies its edits (X13);
  `pack <app>` installs the tarball instead of the source tree.
- Example native init moved to OtelInit.kt / AppDelegate's `otel-init` section so the script reuses it.
- rn-0.79-ios is experimental: RN 0.79.7 does not build on Xcode 27 (author gate, VERIFY.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CocoaPods on RN 0.79)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The one PR dry run passed (Nightly 45353782459, Release 45353782465).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
example-expo lists react-native-open-telemetry in app.json; its own plugin keeps only
example-only edits, and the nightly pack no longer patches the Core pod line for Expo.
Expo resolves the plugin by name through a postinstall link to the repo root (bun cannot
install the root as a file: dependency). The plugin now loads the app's expo/config-plugins
(linked or pnpm installs have none beside the package), and ./app.plugin.js is exported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lize native

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
URI.host is null for hosts such as otel_collector; fall back to the authority without
userinfo and port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tionScope

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry call

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Declares podspecPath for the Nitro adapter and ships the file. RN CLI 20.2's
getDependencyConfig and Expo 58's resolver do not read podspecPath (checked: pointing it at
the Core podspec changes nothing); they pick the first glob hit / the first sorted name,
which is the adapter today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eCore

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rror

RN 0.79 iOS does not build on Xcode 27 (fmt/consteval). The peer range is unchanged
(author decision). The Vite paragraph said the probe logs a warning; it calls console.error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lives

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ream e2e output live

- background-flush: retry the foreground open once (simctl launch can outlast agent-device's 15 s xcrun
  timeout); the 2 s flush tap still proves the main thread is free
- native-test-mode: 30 s for the first read (the 5 s default saw 0 reads on ios-expo)
- clearDeviceLog: log stream --timeout 3m, so a killed worker leaves no stray stream
- e2e stage: inherit stdio, so a long or killed device run shows its progress

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… NaN/Infinity); link the CI perf.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adhorodyski added a commit that referenced this pull request Nov 25, 2026
Layer 5 of the v0 stack (squashed from v0-impl, PR #20):
- compliance job: every captured raw request and verify/expected file replayed into otel collector 0.165.0; any non-2xx fails
- scheduled.yml: nightly matrix (13 entries) with the mark-nightly status
- release.yml + scripts/release-gate.js: publish to `next` after green CI on main; promote to `latest` needs a green nightly
- `version` syncs the distro version constants; changeset for 0.3.0
- README, MIGRATION.md, CONTRIBUTING release steps; spec and plan notes

Nothing here publishes before the npm environment and NPM_TOKEN exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant